package com.java.thread.effective;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * User: wujun
 * Date: 2014/12/9
 */
public abstract class Worker implements Runnable {
    protected Logger logger = LoggerFactory.getLogger(getClass());
    private AtomicInteger atomicInteger = new AtomicInteger();

    protected synchronized int reportNum() {
        return atomicInteger.getAndIncrement();
    }
}
